from transfer.server import server
from transfer.service import BaseService

class Calculator(BaseService):
    # 加法运算
    def add(self, x, y):
        return x + y
    # 减法运算
    def subtract(self, x, y):
        return x - y
    # 乘法运算
    def multiply(self, x, y):
        return x * y
    # 除法运算
    def divide(self, x, y):
        return x / y

server.register_instance(Calculator())
# 启动服务器，ctrl+c退出
server.start()
